Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSEARCH-4674 Use test containers #3796

Merged

Conversation

marko-bekhta
Copy link
Member

https://hibernate.atlassian.net/browse/HSEARCH-4674

the testcontainer+dockerfile+dependabot combination seems to work 🙈 😃
Here're a few PRs opened for DB updates:
marko-bekhta#190
marko-bekhta#188

while I was testing it on my repo I've added:

    username: ${{secrets.MY_DOCKERHUB_USER}}
    password: ${{secrets.MY_DOCKERHUB_TOKEN}}

we probably would need to add some secrets (as I'm not sure it works without the registry)

There's still some cleanup needed, but wanted to see if this still would work on CI

@marko-bekhta marko-bekhta force-pushed the test/HSEARCH-4674-use-test-containers branch 3 times, most recently from d212435 to 8f99544 Compare October 23, 2023 14:50
@marko-bekhta
Copy link
Member Author

Added a test containers BOM and a couple of comments. aaand converting it from the draft 😃

@marko-bekhta marko-bekhta marked this pull request as ready for review October 23, 2023 14:51
Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, here are a few comments.

On the static containers... it's not a hard no, I just feel uncomfortable with something that is so widely frowned upon. If this is standard practice when using test containers, then so be it. But I'd really have felt safer with a solution leveraging JUnit contexts where possible.

build/parents/build/pom.xml Outdated Show resolved Hide resolved
.github/dependabot.yml Outdated Show resolved Hide resolved
build/parents/integrationtest/pom.xml Outdated Show resolved Hide resolved
build/parents/integrationtest/pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes about properties mentioned in CONTRIBUTING.md.

build/parents/integrationtest/pom.xml Show resolved Hide resolved
build/parents/integrationtest/pom.xml Outdated Show resolved Hide resolved
@marko-bekhta marko-bekhta force-pushed the test/HSEARCH-4674-use-test-containers branch from 8f99544 to 0fd2fe8 Compare October 24, 2023 13:23
@marko-bekhta
Copy link
Member Author

There're more changes to come ... I just wanted to test Ruyk on CI 🙈 😃.

@marko-bekhta marko-bekhta force-pushed the test/HSEARCH-4674-use-test-containers branch 12 times, most recently from c78d01c to 177dd6e Compare October 25, 2023 13:42
Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, here are my latest comments...

Did you check how execution time compares to what we had previously with docker-maven-plugin?

build/parents/build/pom.xml Show resolved Hide resolved
build/parents/build/pom.xml Outdated Show resolved Hide resolved
build/parents/integrationtest/pom.xml Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
build/parents/integrationtest/pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Show resolved Hide resolved
@marko-bekhta marko-bekhta force-pushed the test/HSEARCH-4674-use-test-containers branch from ddbb3ad to 0da07c6 Compare October 30, 2023 16:26
@marko-bekhta
Copy link
Member Author

the execution time is more or less the same compared to the maven docker plugin:

Env Test Containers Maven Docker plugin
Opensearch 11m 38s 12m 42s
Oracle 15m 24s 12m 40s
Postgres 9m 53s 9m 25s
Default build ITs 25m 38s 25m 16s

I'll take a look at Oracle tests and why it took that much longer:
Oracle Testcontaienrs:
Hibernate Search ITs - ORM - Jakarta Batch ......... SUCCESS [04:26 min]
Oracle maven-docker-plugin:
Hibernate Search ITs - ORM - Jakarta Batch ......... SUCCESS [02:24 min]

But since previous builds show a time close to 3 min, maybe it's just the change from XE to FREE version of the Oracle container...

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my, I just tried from the IDE: I just change the version in the Jenkinsfile Dockerfile (obviously), run the test and BOOM: a container gets started automatically with the right version. It's awesome.

I added a few comments below, could you please process them?

I also pushed a commit to your branch. The changes are very minor, but please take care to keep it when you rebase :)

Then once you're done rebasing on main (there's a conflict), and maybe after you've squashed a few commits if it makes sense, feel free to merge :)

.github/dependabot.yml Outdated Show resolved Hide resolved
.github/hibernate-github-bot.yml Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
build/container/elastic.Dockerfile Outdated Show resolved Hide resolved
build/container/amazon-opensearch-serverless.Dockerfile Outdated Show resolved Hide resolved
build/container/opensearch.Dockerfile Outdated Show resolved Hide resolved
@yrodiere yrodiere force-pushed the test/HSEARCH-4674-use-test-containers branch from 83ab4f6 to b43bcf0 Compare November 7, 2023 12:55
@marko-bekhta marko-bekhta force-pushed the test/HSEARCH-4674-use-test-containers branch 2 times, most recently from 7d9faad to 777c47f Compare November 7, 2023 16:47
Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please go ahead and squash/fixup what's needed and merge!
Thanks for all this :)

@marko-bekhta marko-bekhta force-pushed the test/HSEARCH-4674-use-test-containers branch from 777c47f to 3717b39 Compare November 8, 2023 07:31
@marko-bekhta marko-bekhta force-pushed the test/HSEARCH-4674-use-test-containers branch from f12b629 to 9860481 Compare November 8, 2023 07:52
Copy link

sonarcloud bot commented Nov 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@marko-bekhta marko-bekhta merged commit 16a0d19 into hibernate:main Nov 8, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants